{extend name="base/common"}

{block name="style"}
<style>
    .shadow{width: 100%;height: 100%;position: absolute;left: 0;top: 0;background: rgba(0,0,0,0.4);z-index: 88;}
    .b{cursor: pointer;}
</style>
{/block}

{block name="page-header"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>学员分配</h2>
        <ol class="breadcrumb">
            <li>
                <a href="{:Url('Student/index')}">分校</a>
            </li>
            <li class="active">
                <strong>分校列表</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">
    </div>
</div>
{/block}

{block name="main"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <form method="get" action="">
                        <div class="col-sm-3">
                            <div class="input-group">
                                <input type="text" placeholder="学校名称" class="input-sm form-control" name="school" value="{notempty name='Think.get.school'}{$Think.get.school}{/notempty}">
                            <span class="input-group-btn">
                                <button type="submit" class="btn btn-sm btn-primary">查询</button>
                            </span>
                            </div>
                        </div></form>
                    <div class="ibox-tools">
                        <select name="year">
                            {volist name="years" id="y"}
                            <option value="{$y.year}" >{$y.year}</option>
                            {/volist}
                        </select>
                        <select name="month">
                            <option value="1" >1月</option>
                            <option value="2" >2月</option>
                            <option value="3" >3月</option>
                            <option value="4" >4月</option>
                            <option value="5" >5月</option>
                            <option value="6" >6月</option>
                            <option value="7" >7月</option>
                            <option value="8" >8月</option>
                            <option value="9" >9月</option>
                            <option value="10" >10月</option>
                            <option value="11" >11月</option>
                            <option value="12" >12月</option>
                        </select>
                        <a href="javascript:window.history.go(-1);" class="btn btn-white btn-sm"><i class="fa fa-reply"></i> 返回</a>
                    </div>
                </div>
                <div class="ibox-content">
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th><input class="i-checks check-all" type="checkbox"></th>
                                <th>序号</th>
                                <th>名称</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr >
                                <td width="10%" data-id="" style="vertical-align: middle"><input type="checkbox" class="i-checks" name="input[]"></td>
                                <td width="10%" style="vertical-align: middle">{$vo.dx_id}</td>
                                <td width="40%" style="vertical-align: middle">{$vo.dx}</td>
                                <td width="40%" style="vertical-align: middle">
                                    <a href="{:Url('Student/student?id='.$vo['dx_id'])}">查看学员</a>&emsp;
                                    <button type="submit" data-id="{$vo.dx_id}" class="btn btn-sm btn-primary post-add">服务导出</button>&emsp;
                                    <button type="submit" data-id="{$vo.dx_id}" class="btn btn-sm btn-primary post-adds">测试导出</button>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                            <tfoot>
                            <tr>
                                <td colspan="10">
                                    <div class="page">{$list->render()}</div>
                                </td>
                            </tr>
                            </tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<iframe id="iframe" src="" style="height: 80%;width: 392px;z-index: 99;position: absolute;top: 10%;border: 0;left: 32%;background: #fff;display: none;" scrolling="auto" seamless></iframe>
<div class="shadow" style="display: none"></div>
<!-- 模态框（Modal） -->
{/block}

{block name="script"}
<script src="__ADMIN__/js/plugins/iCheck/icheck.min.js"></script>
<script>
    highlight_subnav("{:Url('Student/index')}");
    $(document).ready(function(){
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
        $('.check-all').on('ifChecked', function(event){
            $('input').iCheck('check');
        });

        $('.check-all').on('ifUnchecked', function(event){
            $('input').iCheck('uncheck');
        });
    });
    $('.post-add').click(function(){
        var year = $("select[name='year']").val();
        var month = $("select[name='month']").val();
        var school_id = $(this).attr('data-id');
        updateAlert('正在导出中，请稍后！' ,'success');
        window.location.href="http://mp.csppat.com/DDDeducation/public/index.php/admin/student/outpaper/school_id/"+school_id+"/year/"+year+"/month/"+month;
    })
    $('.post-adds').click(function(){
        var year = $("select[name='year']").val();
        var school_id = $(this).attr('data-id');
        updateAlert('正在导出中，请稍后！' ,'success');
        window.location.href="http://mp.csppat.com/DDDeducation/public/index.php/admin/student/outpapers/school_id/"+school_id+"/year/"+year;
    })
</script>
{/block}